import java.util.Arrays;

public class J2410172 {
    public static void main(String[] args) {
        int[] array = {2,6,11,15,7};
        int[] ret = func1(array,9);
        System.out.println(Arrays.toString(ret));
    }
    public static int[] func1(int[] array,int targe){
        for (int i = 0; i <= array.length - 2; i++) {
            for (int j = i+1; j <= array.length - 1; j++) {
                if (array[i] + array[j] == targe){
                    return new int[]{i,j};
                }
            }
        }return new int[]{-1,-1};
    }
}
